import { onUnmounted } from "vue";

const useDOMCreate = (nodeId: string) => {
  // Teleport:https://v3.cn.vuejs.org/guide/teleport.html
  const node = document.createElement("div");
  node.id = nodeId;
  document.body.appendChild(node);
  onUnmounted(() => {
    document.body.removeChild(node);
  });
}

export default useDOMCreate